<?php

namespace Database\Factories;

use App\Models\ESCluster;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Predict>
 */
class PredictFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        $result = [
            ['SOC' => '90',      'SOH' => '93'],
            ['SOC' => '91',      'SOH' => '92'],
            ['SOC' => '92',      'SOH' => '94'],
            ['SOC' => '93',      'SOH' => '95'],
            ['SOC' => '94',      'SOH' => '96'],
            ['SOC' => '95',      'SOH' => '98'],
            ['SOC' => '96',      'SOH' => '98'],
        ];
        return [
            'dev_id' => $this->faker->randomElement(ESCluster::all()->pluck('id')),
            'dev_type' => 'App\Models\ESCluster', 
            'dev_sn' => $this->faker->uuid(), 
            'result'  => $this->faker->randomElement($result),
            // 'advice' => $advice,
            'remarks' => '备注',
        ];
    }
}
